package com.ruoyi.system.mapper.evaluation;

import com.ruoyi.system.domain.evaluation.Location;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface LocationMapper {
    //增加地点
   @Insert("insert into ry.location(id,name) values(#{id},#{name})")
   int insertLocation(Location location);
   //删除地点
   @Delete("delete from ry.location where id=#{id}")
   int deleteLocationById(int id);
   //修改地点名称
    @Update("update ry.location set name=#{name} where id=#{id}")
    int updateLocationById(int id);
    //查询全部地点
    @Select("select * from ry.location")
    List<Location> selectLocation();

    //删除数据
    @Delete("<script>" +
            "delete from ry.location where id in" +
            "<foreach collection='array' item='id' open='(' separator=',' close=')'>" +
            "#{id}" +
            "</foreach>" +
            "</script>")
    int deleteLocation(Long[] ids);
}
